<template>
<div class="flex">
  
  <div class="sousuotop">
      <input type="text" :placeholder="title1">
      <img class="sousuo" src="img/sousuo.jpg" alt="">
      <span class="pifu">{{title2}}</span>
  </div>



<!-- 引入轮播图 -->
<van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
  <van-swipe-item><img class="lunbo" src="img/lunbo1.jpg" alt=""></van-swipe-item>
  <van-swipe-item><img class="lunbo" src="img/lunbo2.jpg" alt=""></van-swipe-item>
  <van-swipe-item><img class="lunbo" src="img/lunbo3.jpg" alt=""></van-swipe-item>
</van-swipe>



<!-- 插入图片 -->
<div class="er1lunb">
<img class="lunb" src="img/lunb1.jpg" alt="">
<img class="lunb" src="img/lunb2.jpg" alt="">
</div>
  

<!-- 输入框上面的导航栏 -->
<div class="home-shudao">
    <span>最新皮肤</span>
    <span>哇哦主题</span>
    <span>简约ins</span>
    <span>卡通联盟</span>
</div>





<!-- 组件的输入框 -->
<div id="shurukuangall">
  <div id="shurukuang" v-for="(v,i) in arr" :key="i">
    <img class="shurukuang" :src="v.img" alt="">
    <p>{{v.title}}</p>
  </div>
</div>



</div>
</template>

<script>
import {homelink} from "@/api/axios.js"

export default {
  // 二级组件头部搜索，使用props正向传值，父组件给子组件传递数据
    props:['title1','title2'],
    data(){
      return{
        arr:[]
      }
    },
    created(){
      homelink("/home/json","get").then((ok)=>{
        console.log(ok.data.homearr)
        this.arr = ok.data.homearr
      })
    },





}
</script>

<style scoped>
.flex{
  margin-bottom: 0.5rem;
}
.sousuotop{
    width: 100%;
    height: 60px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    
}
input{
    height: 0.32rem;
    width: 2.63rem;
    border-radius: 0.1rem;
    border:0.01rem solid gray;
    text-indent: 0.4rem;
    outline: none;
}
.pifu{
    font-size: 0.14rem;
}
.sousuo{
    width: 0.2rem;
    height: 0.2rem;
    position: absolute;
    left: 0.23rem;
    transform: translateY(0%);
}


.my-swipe .van-swipe-item {
   
    height:1.3rem;
    box-sizing: border-box;
    padding:0 0.15rem ;
  }
  .lunbo{
    width: 3.33rem;
    height: 1.12rem;
  }

  .lunb{
    width: 1.62rem;
    height:0.72rem ;
  }
  .er1lunb{
      width: 100%;
      box-sizing: border-box;
      padding: 0 0.15rem;
  }

  /* 输入框上的导航栏 */
.home-shudao{
  width: 100%;
  height: 0.55rem;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  position:sticky;
  top: 0.5rem;
  background-color:white;
}
.home-shudao span{
  display: inline-block;
  height: 0.4rem;
  width: 0.8rem;
  
  text-align: center;
  line-height: 0.4rem;
  font-size: 0.15rem;
}
.home-shudao span:hover{
background-color: #fef0e7;
  border-radius: 0.15rem;
}


  /* 输入框 */
  #shurukuangall{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
  }
  #shurukuang{
    /* width: 50%; */
    height: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .shurukuang{
    width: 1.63rem;
    height: 1.25rem;
  }
</style>